<?php
header("Content-Type: text/html; charset=utf-8");
require_once '../setting/setting.php';
require_once '../smarty/Smarty.class.php';
require_once '../lib/query_railway.php';
require_once '../lib/base.php';
$user=$_SESSION["RU"];
if(!$user)header("Location:../user/login.php");
if($_POST["act"]=="modify") {
	$name=urldecode($_POST["name"]);
	$cname=urldecode($_POST["cname"]);
	$cadd=urldecode($_POST["cadd"]);
	$tel=urldecode($_POST["tel"]);
	$qq=urldecode($_POST["qq"]);
	$msn=urldecode($_POST["msn"]);
	$uremark=urldecode($_POST["uremark"]);

	$_set="set name='".$name."',cname='".$cname."',cadd='".$cadd."',tel='".$tel."',qq='".$qq."',msn='".$msn."',uremark='".$uremark."' where id=".$user["id"];
	$op=QR::update_data($tb_user,$_set);
	if($op>0)echo "100" ;else echo "数据未更新，请检查输入的正确性！";
	exit;
}

$str=" id=".$user["id"];
$data=QR::get_data($tb_user, "*",$str,0,1);
//var_dump($data);
$smarty = new Smarty;
$smarty->assign("udata",$data[0]);
$smarty->assign("user",$user);
$smarty->display('user_modify.tpl');

?>